package com.indexingsystem.system.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.indexingsystem.boss.Vo.GetTaskAssignListReqVo;
import com.indexingsystem.boss.admin.mapper.IdxTaskAssignMapper;
import com.indexingsystem.boss.common.PagedResult;
import com.indexingsystem.boss.entity.IdxTaskAssign;
import com.indexingsystem.boss.utils.BeanUtils;
import com.indexingsystem.system.service.IdxTaskAssignService;
@Service
public class IdxTaskAssignServiceImpl  implements IdxTaskAssignService {
	@Resource
	private  IdxTaskAssignMapper idxTaskAssignMapper;
	@Override
	public int deleteByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return idxTaskAssignMapper.deleteByPrimaryKey( id );
	}

	@Override
	public int insert(IdxTaskAssign record) {
		// TODO Auto-generated method stub
		return idxTaskAssignMapper.insert( record );
	}

	@Override
	public int insertSelective(IdxTaskAssign record) {
		// TODO Auto-generated method stubinsertSelective
		return idxTaskAssignMapper.insertSelective( record );
	}

	@Override
	public IdxTaskAssign selectByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return idxTaskAssignMapper.selectByPrimaryKey( id );
	}

	@Override
	public int updateByPrimaryKeySelective(IdxTaskAssign record) {
		// TODO Auto-generated method stub
		return idxTaskAssignMapper.updateByPrimaryKeySelective( record );
	}

	@Override
	public int updateByPrimaryKey(IdxTaskAssign record) {
		// TODO Auto-generated method stub
		return idxTaskAssignMapper.updateByPrimaryKey( record );
	}

	@Override
	public int getTaskAssignListCount(GetTaskAssignListReqVo getTaskAssignListReqVo) {
		// TODO Auto-generated method stub
		return idxTaskAssignMapper.getTaskAssignListCount( getTaskAssignListReqVo );
	}

	@Override
	public PagedResult<IdxTaskAssign> getTaskAssignList(GetTaskAssignListReqVo getTaskAssignListReqVo) {
		  Integer pageNo = getTaskAssignListReqVo.getPageNo() == null ? 1 : getTaskAssignListReqVo.getPageNo();
	        Integer pageSize = getTaskAssignListReqVo.getPageSize() == null ? 10 : getTaskAssignListReqVo.getPageSize();
	        // startPage是告诉拦截器说我要开始分页了。分页参数是这两个。
	        PageHelper.startPage( pageNo, pageSize );
	        return BeanUtils.toPagedResult( idxTaskAssignMapper.getTaskAssignList( getTaskAssignListReqVo ) );
	}

	@Override
	public Integer deleteByIdBatch(List<String> list) {
		// TODO Auto-generated method stub
		return idxTaskAssignMapper.deleteByIdBatch( list );
	}

}
